/*
 * @Author: jianfanfan 是是是
 * @Date: 2025-08-23 15:18:08
 * @LastEditors: jianfanfan 是是是
 * @LastEditTime: 2025-08-25 17:06:27
 * @FilePath: \dlabel-web-print\src\renderer\src\App.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Versions from './components/Versions'
import electronLogo from './assets/electron.svg'
// import { Layout } from 'antd'
// const { Content } = Layout
async function App(): React.JSX.Element {
  const ipcHandle = (): void => window.electron.ipcRenderer.send('ping')
  const result = await window.api.scanTsplPrinters()
  if (result?.success) {
    console.log('printers', result.printers)
  } else {
    console.error('scan failed', result)
  }

  return (
    <>
      <img alt="logo" className="logo" src={electronLogo} />
      <div className="creator">Powered by electron-vite</div>
      <div className="text">
        Build an Electron app with <span className="react">React</span>
        &nbsp;and <span className="ts">TypeScript</span>
      </div>
      <p className="tip">
        Please try pressing <code>F12</code> to open the devTool
      </p>
      <div className="actions">
        <div className="action">
          <a href="https://electron-vite.org/" target="_blank" rel="noreferrer">
            Documentation
          </a>
        </div>
        <div className="action">
          <a target="_blank" rel="noreferrer" onClick={ipcHandle}>
            Send IPC
          </a>
        </div>
      </div>
      <Versions></Versions>
    </>
  )
}

export default App
